from redis import Redis
from rq import Queue

from application.config import appSettings


# 连接 Redis 指定异步任务 DB
redis = Redis(host=appSettings.async_redis_host, port=appSettings.async_redis_port, password=appSettings.async_redis_auth, db=appSettings.async_redis_db)
# redis = Redis.from_url(appSettings.redis_url)

# 超时时间 16600 秒
scheduler = Queue('default', connection=redis, default_timeout=16600)

# print(scheduler.connection)

__all__ = ['scheduler']
